package com.luofan.common.result;

import lombok.Getter;

/**
 * 统一返回结果状态信息类
 */
@Getter
public enum ResultCodeEnum {

    SUCCESS(200, "成功"),
    FAIL(201, "失败"),

    SAVE_ERROR(202, "数据添加失败"),
    UPDATE_ERROR(203, "数据更新失败"),
    REMOVE_ERROR(204, "数据删除失败"),
    SELECT_ERROR(205, "数据查询失败"),
    FILE_UPLOAD_ERROR(211, "文件上传失败"),
    FILE_DOWNLOAD_ERROR(212, "文件下载失败"),
    FILE_ACQUIRE_ERROR(213, "文件获取失败"),
    FILE_FORMAT_ERROR(214, "文件格式错误"),

    SERVICE_ERROR(220, "服务异常"),
    DATA_ERROR(221, "数据异常"),
    ILLEGAL_REQUEST(222, "非法请求"),
    REPEAT_SUBMIT(223, "重复提交"),
    FEIGN_FAIL(224, "远程调用失败"),

    SIGN_ERROR(300, "签名错误"),
    SIGN_OVERDUE(301, "签名已过期"),
    LOGIN_AUTH(302, "未登陆"),
    ACCOUNT_ERROR(303, "账号或密码不正确"),
    PASSWORD_ERROR(304, "密码不正确"),
    VERIFICATION_ERROR(305, "验证码错误"),
    PERMISSION(306, "没有权限"),
    ACCOUNT_STOP(307, "账号已停用"),

    ARGUMENT_VALID_ERROR(400, "参数校验异常"),
    PARAMETER_NULL(401, "参数为空"),
    NODE_ERROR(402, "该节点下有子节点，不可以删除"),
    EXIST_ERROR(430, "数据已存在"),
    NONEXISTENCE_ERROR(431, "数据不存在"),
    EXIST_HEAD_ERROR(441, "该教研室已有主任"),
    HOLIDAY_WARN(461, "学校已放假"),


    SERVER_ERROR(500, "服务器异常"),
    ILLEGAL_ACCESS(501, "非法访问");

    private Integer code;

    private String message;

    private ResultCodeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
}